import  axios from  'axios'

export default class Hospitaldrugs {
    static hospitaldrugs = null

    static getInstance(){
        if(this.hospitaldrugs == null){
            this.hospitaldrugs = new Hospitaldrugs()
        }
        return this.hospitaldrugs
    }

    list(params){
        return axios.get(`http://localhost/drugs/medicines/page`,{
            params: params
        })
    }

    del(medicinesId){
        return axios.delete(`http://localhost/drugs/medicines/deldrugs/${medicinesId}`)
    }

    add(Drugsparams){
        return axios.post(`http://localhost/drugs/medicines`,Drugsparams)
    }
    
    getMaxCode(){
        return axios.get('http://localhost/drugs/medicines/code')
    }

}